#pragma once
#include "Sock.h"

class  SNETWORK_API Sock::CNluList 
{
public:
    static CNluList *instance();
    
    /**
     * **create list**
     *
     * @return http_chain_t *head   head node 
     */
    http_chain_t *createList_L();
    
    /**
     * @param http_chain_t *q       prev node
     * @param http_buf_t *b         need to save struct
     * @param size_t file           need to send file
     * @return http_chain_t *p      now create node
     */
    http_chain_t *listInsert_L(http_chain_t *out_head, http_chain_t *q, http_buf_t *b, long len, http_file_t *file);
    
    /**
     * **insert list**
     * @param http_chain_t *out_head    header node
     * @param http_chain_t *q           prev node
     * @return http_chain_t *p          now create node
     */
    http_chain_t *listInsert_L(http_chain_t *out_head, http_chain_t *q, http_buf_t *b, size_t len);
    
    /**
     * @param http_chain_t *q       prev node
     *        http_chain_t *p       need to delete node
     *
     * @return void     
     */
    void CListDelete_L(http_chain_t *out_head, http_chain_t *p);
    
    /**
     *  **list drop**
     * @param http_chain_t *head    head node
     * @return void
     */
    void listDrop_L(http_chain_t *head);
protected:

	
private: 
    static CNluList* m_instance;
    CNluList();    
    class CGarbo {public: ~CGarbo(){if (CNluList::m_instance) delete CNluList::m_instance;}};
    static CGarbo Garbo;	
};
